{include file="pub:header" /}
<script type="text/javascript">
function setSort() {
    $('#myform').attr('action', "{:url('rolesort')}" );
    ajaxpost('myform');
}
</script>
</head>
<body>


<div class="subnav">
    <div class="content_menu ib_a blue line_x">
        <a href="javascript:;"><span class="pagetitle">【角色管理】</span></a>
        <span>|</span>
    	<a class="add fb J_showdialog" href="{:url('roledit')}" data-title="添加角色"><em>添加角色</em></a>　
    </div>
</div>

<div class="pad_lr_10">
    <div class="J_tablelist table_list">
        <form action="" id="myform">
        <table width="100%" cellspacing="0">
            <thead>
            <tr>
				<th width="60">编号</th>
				<th align="left">名称</th>
				<th width="200">排序</th>
				<th width="200">状态</th>
				<th>操作</th>
            </tr>
            </thead>

    	    <tbody>

				{foreach name="list" item="vo"}
					<tr>
					    <td align="center">{$vo['id']}</td>
						<td>{$vo['title']}</td>
                        <td align="center"><input type="text" style="text-align:center;" class="input-text" name="sort[{$vo['id']}]" value="{$vo['sort']}" size="8"></td>
						<td align="center">
						   <img  src="/static/admin/img/toggle_{$vo['state']?'enabled':'disabled'}.gif" />
						</td>
						<td align="center">
							【<a href="{:url('roledit',array('id'=>$vo['id']))}">修改</a>】
                            {if condition="$vo['state'] eq 1"}
                            【<a href="javascript:void(0);" onclick="ajaxget('{:url('rolestate',array('id'=>$vo['id'],'state'=>0))}','确认禁用该角色吗?');">禁用</a>】
                            {else/}
                            【<a href="javascript:void(0);" onclick="ajaxget('{:url('rolestate',array('id'=>$vo['id'],'state'=>1))}','确认启用该角色吗?');">启用</a>】
                            {/if}
							【<a href="javascript:void(0);" onclick="ajaxget('{:url(\'roledel\',array(\'id\'=>$vo[\'id\']))}','删除后不可恢复，确定删除吗？')">删除</a>】
						</td>
					</tr>
				{/foreach}
            </tbody>
        </table>
        </form>
    </div>

    <div class="btn_wrap_fixed">
        <input type="button" class="btn"onclick="setSort();" value="排序" />
    </div>

</div>

{include file="pub:footer" /}
